package org.example.filter;

import org.apache.dubbo.common.extension.Activate;
import org.apache.dubbo.rpc.*;

import static org.apache.dubbo.common.constants.CommonConstants.PROVIDER;

/**
 * @Author: tang
 * @Description:
 * @Date 2025/8/3 22:36
 */
@Activate(group = PROVIDER)
public class MyFilter implements Filter {
    @Override
    public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException {

        System.out.println("MyFilter " + invocation.getServiceName());

        Result result = invoker.invoke(invocation);

        result.setValue("MyFilter " + result.getValue());

        System.out.println("MyFilter " + invocation.getMethodName());

        return result;
    }
}
